package com.googlecode.tinyjava.syntaxtree;

import lombok.Getter;
import lombok.Setter;

public class DyadicExpression extends Expression {
	@Getter
	@Setter
	private Expression left;
	@Getter
	@Setter
	private Expression right;

	public DyadicExpression(Expression left, Expression right) {
		super();
		this.left = left;
		this.right = right;
	}
	
	public DyadicExpression(Expression left, Expression right, String operand) {
		super();
		this.left = left;
		this.right = right;
		this.operator = operand;
	}

	public void print() {
		if (left != null)
			left.print();
		System.out.print(" " + operator + " ");
		if (right != null)
			right.print();
	}
}
